package wqh.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import wqh.dao.DtSensorDao;
import wqh.domain.DtSensor;
import wqh.service.DtSensorService;

import java.util.List;

/**
 * Created by devts on 2016/11/30.
 */
@Service("dtSensorService")
public class DtSensorServiceImpl implements DtSensorService{

    @Autowired
    private DtSensorDao dtSensorDao;

    public List<DtSensor> findAll() {
        return dtSensorDao.findAll();
    }

    public List<DtSensor> findByDeviceId(Integer id) {
        return dtSensorDao.findByDeviceId(id);
    }

    public DtSensor findByDeviceIdAndCode(Integer id, String code) {
        return dtSensorDao.findByDeviceIdAndCode(id, code);
    }

    public DtSensor findById(Integer id) {
        return dtSensorDao.findById(id);
    }

    public int insert(DtSensor dtSensor) {
        return dtSensorDao.insert(dtSensor);
    }

    public int updateById(DtSensor dtSensor) {
        return dtSensorDao.updateById(dtSensor);
    }

    public int deleteById(Integer id) {
        return dtSensorDao.deleteById(id);
    }

    public int deleteByDeviceId(Integer id) {
        return dtSensorDao.deleteByDeviceId(id);
    }
}
